<template>
  <div>
    <ul>
      <li v-for="(item,n) in arr" :key="item">
        <span>{{ item }}　</span>
        <button @click="removebtn(n)">删除</button>
      </li>
    </ul>
    <button @click="addbtn">增加</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [1, 3, 5],
    }
  },
  methods: {
    removebtn(m){
     this.arr.splice(m,1)
    },
    addbtn(){
     this.arr.push(Math.floor(Math.random() * 20))
    }
  }
};
</script>

<style>
</style>